package x.mybatis.metadata;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 表元数据缓存
 *
 * @author hanjuntao
 * @date 2025/5/9 0009
 */
public class TableMetadataHolder {
    private TableMetadataHolder() {}

    private static final Map<String, TableMetadata> TABLE_METADATA_MAP = new ConcurrentHashMap<>();

    public static void put(Class<?> entityClass, TableMetadata tableMetadata) {
        TABLE_METADATA_MAP.put(entityClass.getName(), tableMetadata);
    }

    public static TableMetadata get(Class<?> entityClass) {
        return TABLE_METADATA_MAP.get(entityClass.getName());
    }
}
